import Vue from "vue";
import VueRouter from "vue-router";
import Layout from '@/views/layout/Index.vue'
import Login from '@/views/login/Index.vue'
import Home from '@/views/home/Home.vue'
const Monitor = () => import('@/views/ele monitor/Index.vue')
const Transformer = () => import('@/views/ele monitor/transformer/Index.vue')
const DistributDiagram = () => import('@/views/ele monitor/distributDiagram/Index.vue')
const ElectricRawData = () => import('@/views/ele monitor/electricRawData/Index.vue')
const ElectricExtremumData = () => import('@/views/ele monitor/electricExtremumData/Index.vue')
const ElectricReport = () => import('@/views/ele monitor/electricReport/Index.vue')
const ExtremumReport = () => import('@/views/ele monitor/extremumReport/Index.vue')

const Analysis = () => import('@/views/analysis/Index.vue')
const EnergyData = () => import('@/views/analysis/EnergyData/Index.vue')
const EnergyMOM = () => import('@/views/analysis/EnergyMOM/Index.vue')
const EnergyYOY = () => import('@/views/analysis/EnergyYOY/Index.vue')

const Environment = () => import('@/views/environment/Index.vue')
const CableTemperature = () => import('@/views/environment/CableTemperature/Index.vue')
const TempHumidityData = () => import('@/views/environment/TempHumidityData/Index.vue')
const MeterLink = () => import('@/views/environment/TempHumidityData/Index.vue')
const GatewayLink = () => import('@/views/environment/GatewayLink/Index.vue')

const Record = () => import('@/views/record/Index.vue')
const AlarmOverVal = () => import('@/views/record/AlarmOverVal/Index.vue')
const AlarmOffline = () => import('@/views/record/AlarmOffline/Index.vue')
const MsgCenter = () => import('@/views/record/MsgCenter/Index.vue')

const Setting = () => import('@/views/setting/Index.vue')
const Station = () => import('@/views/setting/station/Index.vue')
const TransformerSetting = () => import('@/views/setting/transformerSetting/Index.vue')
const Gateway = () => import('@/views/setting/gateway/Index.vue')
const Meter = () => import('@/views/setting/meter/Index.vue')
const Loop = () => import('@/views/setting/loop/Index.vue')
const Svg = () => import('@/views/setting/svg/Index.vue')
const SvgConfig = () => import('@/views/setting/svgConfig/Index.vue')
const ResetPassword = () => import('@/views/setting/resetPassword/Index.vue')
Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        name: 'home',
        component: Home
      },
      {
        path: '/monitor',
        name: 'monitor',
        component: Monitor,
        children: [
          {
            path: 'transformer',//访问路径为:/monitor/transformer
            name: 'transformer',
            component: Transformer
          },
          {
            path: 'distributDiagram',//访问路径为:/monitor/distributDiagram
            name: 'distributDiagram',
            component: DistributDiagram
          },
          {
            path: 'electricRawData',//访问路径为:/monitor/electricRawData
            name: 'electricRawData',
            component: ElectricRawData
          },
          {
            path: 'electricExtremumData',//访问路径为:/monitor/electricExtremumData
            name: 'electricExtremumData',
            component: ElectricExtremumData
          },
          {
            path: 'electricReport',//访问路径为:/monitor/electricReport
            name: 'electricReport',
            component: ElectricReport
          },
          {
            path: 'extremumReport',//访问路径为:/monitor/extremumReport
            name: 'extremumReport',
            component: ExtremumReport
          },
        ]
      },
      {
        path: '/analysis',
        name: 'analysis',
        component: Analysis,
        children: [
          {
            path: 'energyData',//访问路径为:/analysis/energyData
            name: 'energyData',
            component: EnergyData
          },
          {
            path: 'energyMOM',//访问路径为:/analysis/EnergyMOM
            name: 'energyMOM',
            component: EnergyMOM
          },
          {
            path: 'energyYOY',//访问路径为:/analysis/EnergyYOY
            name: 'energyYOY',
            component: EnergyYOY
          },
        ]
      },
      {
        path: '/environment',
        name: 'environment',
        component: Environment,
        children: [
          {
            path: 'cableTemperature',//访问路径为:/environment/cableTemperature
            name: 'cableTemperature',
            component: CableTemperature
          },
          {
            path: 'tempHumidityData',//访问路径为:/environment/tempHumidityData
            name: 'tempHumidityData',
            component: TempHumidityData
          },
          {
            path: 'meterLink',//访问路径为:/environment/meterLink
            name: 'meterLink',
            component: MeterLink
          },
          {
            path: 'gatewayLink',//访问路径为:/environment/gatewayLink
            name: 'gatewayLink',
            component: GatewayLink
          },
        ]
      },
      {
        path: '/record',
        name: 'record',
        component: Record,
        children: [
          {
            path: 'alarmOverVal',//访问路径为:/record/alarmOverVal
            name: 'alarmOverVal',
            component: AlarmOverVal
          },
          {
            path: 'alarmOffline',//访问路径为:/record/alarmOffline
            name: 'alarmOffline',
            component: AlarmOffline
          },
          {
            path: 'msgCenter',//访问路径为:/record/msgCenter
            name: 'msgCenter',
            component: MsgCenter
          },
        ]
      },
      {
        path: '/setting',
        name: 'setting',
        component: Setting,
        children: [
          {
            path: 'station',//访问路径为:/setting/station
            name: 'station',
            component: Station
          },
          {
            path: 'transformerSetting',//访问路径为:/setting/transformerSetting
            name: 'transformerSetting',
            component: TransformerSetting
          },
          {
            path: 'gateway',//访问路径为:/setting/gateway
            name: 'gateway',
            component: Gateway
          },
          {
            path: 'meter',//访问路径为:/setting/meter
            name: 'meter',
            component: Meter
          },
          {
            path: 'loop',//访问路径为:/setting/loop
            name: 'loop',
            component: Loop
          },
          {
            path: 'svg',//访问路径为:/setting/svg
            name: 'svg',
            component: Svg
          },
          {
            path: 'svgConfig',//访问路径为:/setting/svgConfig
            name: 'svgConfig',
            component: SvgConfig
          },
          {
            path: 'resetPassword',//访问路径为:/setting/resetPassword
            name: 'resetPassword',
            component: ResetPassword
          },
        ]
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
